package com.itheima.service;

import com.itheima.dao.IDao;
import com.itheima.doamin.Student;
import com.itheima.factory.Factory;

import java.util.ArrayList;

public class ServiceImpl implements Iservice {

    private IDao dao = Factory.getDao();

    @Override
    public void addStudent(Student s) {
        dao.addStudent(s);
    }

    @Override
    public void deleteStudentById(String id) {
        dao.deleteStudentById(id);
    }

    @Override
    public void updateStudent(String id, Student student) {
        dao.updateStudent(id, student);
    }

    @Override
    public ArrayList<Student> findAllStudents() {
        return dao.findAllStudents();
    }
}
